Skip to main content

Prerequisites

Before installing PVAC-HFHE, ensure your development environment meets these requirements:
1

C++17 compiler

You need a compiler that supports C++17 or later:
  • GCC: Version 9 or higher
  • Clang: Version 10 or higher
  • MSVC: Visual Studio 2019 or higher
2

x86-64 processor (recommended)

For optimal performance, use a processor with PCLMUL support. Most modern Intel and AMD processors include this instruction set.Check PCLMUL support on Linux:
PVAC-HFHE will work without PCLMUL, but cryptographic operations will be slower.

Clone the repository

PVAC-HFHE is a header-only library, so installation is straightforward:

Project structure

After cloning, your directory should look like this:

Include in your project

PVAC-HFHE is header-only, so you just need to add the include path:
Always use -march=native flag to enable CPU-specific optimizations, including PCLMUL instructions if available.

Compiler flags explained

For production builds, consider using -O3 for maximum optimization, though it may increase compilation time.

Verify installation

Test your installation by building and running the examples:
1

Build examples

This compiles all example programs in the examples/ directory.
2

Run basic usage example

You should see output showing successful encryption, homomorphic operations, and decryption:
3

Run test suite (optional)

Verify everything works correctly by running the full test suite:
This runs 42 comprehensive tests covering all library functionality.

Integration methods

Method 1: Direct include path

Add the PVAC-HFHE include directory to your compiler flags:

Method 2: Copy headers to system path

Copy headers to your system include directory:
Then compile without the -I flag:

Method 3: CMake integration

For CMake projects, add the include directory:
CMakeLists.txt

Troubleshooting

This indicates your compiler doesn’t fully support C++17. Update to:
  • GCC 9 or higher
  • Clang 10 or higher
  • MSVC 2019 or higher
PVAC-HFHE is header-only and doesn’t require linking. Ensure you’re including pvac/pvac.hpp in your source files.
Ensure you’re compiling with optimization flags:
  • Add -O2 or -O3 for optimization
  • Add -march=native to enable CPU-specific instructions
  • Check that your CPU supports PCLMUL instructions
Verify the include path is correct:

Next steps

Quickstart guide

Build your first homomorphic encryption application.

Basic operations

Learn the fundamental operations for working with encrypted data.